<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/2/26
 * Time: 10:12
 */
header("Content-type:JSON;charset=utf-8");  //统一输出编码为utf-8
header("Access-Control-Allow-Origin:*");//允许跨域


if($_SERVER["REQUEST_METHOD"]=="POST"){
    //post得大写
    $usertel=$_POST["userTel"];
    $dpIp="127.0.0.1";
    $dbUser="root";
    $dbPwd="";
    $dbDatabase="zhiwoyaowang";
    $conn=new mysqli($dpIp,$dbUser,$dbPwd,$dbDatabase);
    mysqli_query($conn,"set names utf8");
    $sql="SELECT * FROM userinfo 
WHERE u_tel=('".$usertel."')";
    $result=$conn->query($sql);

    if($result->num_rows==1){
        print_r(json_encode(false));
    }else {
        print_r(json_encode(true));
    }
}
$conn->close();